package com.meilingcloud.biobank.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 容器 对象 bank_container
 *
 * @author chenl
 * @date 2021-01-25
 */
@ApiModel(value = "容器对象", description = "容器 对象")
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bank_container")
public class Container implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 容器ID
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "container_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long containerId;

    /**
     * 父容器节点ID
     */
    @ApiModelProperty(value = "父容器节点ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    /**
     * 容器类型
     */
    @ApiModelProperty(value = "容器类型")
    @NotNull(message = "容器类型不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long containerTypeId;

    /**
     * 容器名称
     */
    @ApiModelProperty(value = "容器名称")
    private String containerName;

    /**
     * 容器描述
     */
    @ApiModelProperty(value = "容器描述")
    private String containerDesc;

    /**
     * 容器格式化位置
     */
    private String containerLocation;

    /**
     * 容器同层级排序
     */
    @ApiModelProperty(value = "容器同层级排序")
    @NotNull(message = "排序不能为NULL")
    private Integer containerSort;

    /**
     * 当前存储数量
     */
    @ApiModelProperty(value = "当前存储数量")
    private Integer currentCount;

    /**
     * 容器储存总数
     */
    @ApiModelProperty(value = "容器储存总数")
    private Integer totalCount;

    /**
     * 盒行数
     */
    @ApiModelProperty(value = "盒行数")
    private Integer boxRow;

    /**
     * 盒列数
     */
    @ApiModelProperty(value = "盒列数")
    private Integer boxColumn;

    /**
     * 盒布局(交叉/规则)
     */
    @ApiModelProperty(value = "盒布局")
    private String boxLayout;

    /**
     * 容器所存样品类型
     */
    @ApiModelProperty(value = "容器所存样品类型")
    private String containerSampleType;

    /**
     * 盒编码
     */
    @ApiModelProperty(value = "盒编码")
    private String boxBarcode;

    /**
     * 绑定设备ID
     */
    @ApiModelProperty(value = "绑定设备ID")
    private String deviceId;

    /**
     * 容器状态(0-正常 1-停用)
     */
    @ApiModelProperty(value = "容器状态")
    private String status;

    /**
     * 删除标志(0-存在 1-删除)
     */
    @TableLogic(value = "0", delval = "1")
    private String delFlag;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 容器标题
     */
    @TableField(exist = false)
    private String title;

    /**
     * 存储率
     */
    @TableField(exist = false)
    private Double storageRate;

    /**
     * 容器类型编号
     */
    @TableField(exist = false)
    private String containerTypeCode;

    /**
     * 容器层级
     */
    @TableField(exist = false)
    private Integer containerLevel;

    /**
     * 父容器类型编号
     */
    @TableField(exist = false)
    private String parentContainerTypeCode;

    /**
     * 容器类型名称
     */
    @TableField(exist = false)
    private String containerTypeName;

    /**
     * 容器图标
     */
    @ApiModelProperty(value = "容器图标")
    @TableField(exist = false)
    private String containerIcon;

    /**
     * 存储的样本类型
     */
    @TableField(exist = false)
    private List<String> sampleTypes;

    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();

}
